package com.naiterui.ehp.bs.wechat.protocol.msg.template;

import java.io.Serializable;
import java.util.Map;

import org.apache.commons.lang3.builder.ToStringBuilder;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.naiterui.ehp.bs.wechat.protocol.msg.IPoster;

/**
 * @Description: 【微信接口协议】公众号模板消息
 * @Author: zhoupeipei
 * @Date： 2019/1/30
 */
public class TemplateMsg implements IPoster, Serializable {
    private static final long serialVersionUID = -3948836397887985323L;
    @JsonProperty("touser")
    private String toUser;
    @JsonProperty("template_id")
    private String templateId;
    private Map<String, Data> data;

    public TemplateMsg() {
    }

    public TemplateMsg(String openId, String templateId) {
        super();
        toUser = openId;
        this.templateId = templateId;
    }

    public String getToUser() {
        return toUser;
    }

    public void setToUser(String toUser) {
        this.toUser = toUser;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public Map<String, Data> getData() {
        return data;
    }

    public void setData(Map<String, Data> data) {
        this.data = data;
    }

    public static class Data {
        private Object value;
        private String color;

        public Data(Object value, String color) {
            this.value = value;
            this.color = color;
        }

        public Object getValue() {
            return value;
        }

        public void setValue(Object value) {
            this.value = value;
        }

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        @Override
        public String toString() {
            return ToStringBuilder.reflectionToString(this);
        }
    }

}
